﻿using System.Windows.Input;
using MainGameModule.Views;
using Microsoft.Practices.Composite.Presentation.Commands;
using Microsoft.Practices.Composite.Regions;
using Microsoft.Practices.Unity;
using YourWorld.Common;

namespace MainGameModule.ViewModels
{
    public class TutorialViewModel : ViewModelBase
    {
        private IRegionManager regionManager;
        private IUnityContainer container;

        public ICommand CloseTutorialCommand
        {
            get;
            private set;
        }

        public TutorialViewModel(IRegionManager regionManager, IUnityContainer container)
        {
            this.regionManager = regionManager;
            this.container = container;

            this.CloseTutorialCommand = new DelegateCommand<string>(this.CloseTutorial);
        }

        private void CloseTutorial(string notUsed)
        {
            this.regionManager.Regions[RegionNames.GamePopUpRegion].Deactivate(this.container.Resolve<TutorialView>());
        }
    }
}
